﻿namespace AntBot
{
	public struct Square
	{
		public const char WATER = '%';
		public const char FOOD = '*';
		public const char MY_ANT = 'a';
		public const char UNKNOWN = '?';
		public const char FOG = '~';
		public const char LAND = '.';

		public bool IsWater;
		public bool IsFood;
		public int Ant;
		public int LastSeen;

		//resets the information for the square except water information
		public void Reset()
		{
			//IsFood = false;
			Ant = State.NO_ANT;
		}

		public char GetChar(int turn)
		{
			if (IsWater) return WATER;
			if (IsFood) return FOOD;
			if (Ant > State.NO_ANT)
				return (char)(MY_ANT + Ant - 1);
			if (LastSeen == 0) return UNKNOWN;
			return LastSeen < turn ? FOG : LAND;
		}
	}
}
